Skip to content

Conversation

@nordync
Copy link

@nordync nordync commented Dec 20, 2025

Win32 port: fix MinGW build failure caused by timeapi.h

Description

The Win32 simulator port unconditionally includes <timeapi.h>,
which is available when building with MSVC but not consistently
available when building with MinGW-w64 GCC.

This change guards the include using _MSC_VER and relies on
<mmsystem.h> for MinGW builds, restoring build compatibility
without affecting MSVC builds.

Test Steps

  1. Build FreeRTOS Win32 simulator using MSVC (no regression)
  2. Build FreeRTOS Win32 simulator using MinGW-w64 GCC
  3. Confirm successful compilation and execution

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

Fixes #1344

@sonarqubecloud
Copy link

@aggarg
Copy link
Member

aggarg commented Dec 22, 2025

We already have this code block which includes mmsystem.h. Does it mean that we need to move #include <timeapi.h> to the #else block?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]Win32 port: timeapi.h include breaks MinGW builds (GCC)

3 participants